Closed Bug 1021142 Opened 11 years ago Closed 11 years ago

refresh_product_info_block leaks file handle on failure

Categories

(Toolkit :: Application Update, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: mccr8, Assigned: shashank, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, memory-leak, Whiteboard: [CID 1123276] )

Attachments

(1 file)

fp = fopen(path, "r+b"); ... if (fread(&additionalBlockSize, sizeof(additionalBlockSize), 1, fp) != 1) { // fp isn't closed return -1; } ... if (fread(&additionalBlockID, sizeof(additionalBlockID), 1, fp) != 1) { // fp isn't closed return -1; }
Can you provide a DXR link to that, and I'll shop it around?
Whiteboard: [CID 1123276] → [CID 1123276] [mentor=mccr8]
Mentor: continuation
Whiteboard: [CID 1123276] [mentor=mccr8] → [CID 1123276]
Do two simple 'fclose(fp)' statements suffice?
Yes, I think so.
Comment on attachment 8479512 [details] [diff] [review] BUG 1021142 - 'fclose()' at 2 places to avoid leaks on failure r=mccr8 Review of attachment 8479512 [details] [diff] [review]: ----------------------------------------------------------------- Is this something you could review, Brian? Thanks.
Attachment #8479512 - Flags: review?(continuation) → review?(netzen)
Comment on attachment 8479512 [details] [diff] [review] BUG 1021142 - 'fclose()' at 2 places to avoid leaks on failure r=mccr8 Review of attachment 8479512 [details] [diff] [review]: ----------------------------------------------------------------- Sorry for the delay and thanks for the patch!
Attachment #8479512 - Flags: review?(netzen) → review+
I'll do a try run later today.
Assignee: nobody → shashank
Flags: needinfo?(continuation)
Flags: needinfo?(continuation)
Try looks good. Thanks for the patch!
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: